1) Field of the Invention
The present invention relates to a bar-code reader and a method of reading the bar code to determine a basic width of the bar code.
2) Description of the Related Art
Products are managed by providing a bar code to the product and identifying the product by reading this bar code optically. Since the bar code labels can be prepared at a low cost by printing etc., by using such bar code labels, it is possible to reduce the management cost substantially.
The bar-code labels attached to the products are read using a bar code reader. Such a bar code reader generally includes an optical system like a laser reader, a charged coupled device (CCD) camera etc. The bar code reader receives light that is reflected from a bar code label, determines a pattern of the white lines and the black lines in the bar code from the optical power of the light reflected, and then decodes this pattern to obtain character data that is a pattern of numerals and characters. Such a bar code reader has been disclosed in, for example, Japanese Patent Application Laid-open Application No. S55-143682.
The accuracy of reading of a bar code varies according to the position of receiving of the reflected light, i.e. the position of the photodiode. Thus, the position of the photodiode is an important factor that decides the accuracy.
Generally the conventional bar-code readers are equipped with a single circuit board and a photodiode that receives the light that is reflected from a bar-code label and an arithmetic unit that decodes the bar code are installed on this circuit board. When the photodiode is installed on the circuit board along with the arithmetic unit or other components, the positions where the photodiode can be installed are limited so that sometimes the photodiode cannot be installed in a suitable position that allows increased accuracy of reading. If the photodiode is not installed in the suitable position, there is a decline in the accuracy.
Widths of the bars in a bar code are regulated to be an integral multiple of a basic width. When a bar code is decoded, the multiple numbers (hereinafter, “width number”) for each bar is determined. Therefore, the basic width must be determined accurately, because, the accuracy of reading of a bar code depends on how accurate is the basic width.
However, in conventional bar-code readers, there are cases where the basic width of a bar code cannot be calculated accurately, thereby resulting in decline in the accuracy of reading.
For example, a method of calculating has been used conventionally in which a differential waveform is formed by differentiating a scan result of a bar code and the basic width is calculated from a distance between peaks (hereinafter peak-to-peak distance) of the differential waveform. However, this method was based on an assumption that all the peaks can be acquired and when a peak corresponding to a bar having a small width number cannot be detected, a greater value as compared to the original basic width is calculated as the basic width.
Concretely, for example, when a diameter of a laser beam is greater as compared to a bar that has a width number 1, the peak value corresponding to a white bar and a black bar having a width number 1, is smaller as compared to the peak value of a bar that has a width number not less than 2. As a result of this, if the peak value corresponding to a bar having a width number 1 is less than a threshold value, the peak of a spectrum that is detected is only the peak corresponding to a bar that has a width number not less than 2. Thus, when a peak that corresponds to a bar having a width number 1 cannot be detected, in the conventional bar-code reader, a width that is equivalent to a width number not less than 2 is miscalculated as a basic width.
Moreover, in a method of calculating the basic width, a waveform in which a differential waveform of a scan result is squared, is subjected to fast Fourier transform (FFT). After the transformation, a frequency from the spectrum that becomes a gain peak is considered as the basic width frequency. However, if this method is employed, while reading an area where the beam diameter is thick, amplitude of the basic width frequency becomes extremely small and a false gain peak frequency that is greater than the gain in the real basic width frequency is realized. Due to this, the basic-width frequency cannot be extracted correctly.
Particularly, when the distance between a laser element and a bar code is long, the outward diameter of laser beam becomes large, thereby resulting in remarkable decline in the accuracy of reading. Therefore, in the conventional bar-code readers, it is necessary that the bar code be brought near to the position of laser emission. In other words, in the conventional bar-code readers, the range of bar-code reading was narrow.